﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Adams.Web.Logic.Security
{
    public class ConfirmEmail
    {
        public static Models.Security.ConfirmEmail.PageLoad PageLoad(string code)
        {
            var model = new Models.Security.ConfirmEmail.PageLoad();

            if (string.IsNullOrEmpty(code))
            {
                model.IsEmailConfirmed = false;
            }
            else
            {
                string email = Logic.Email.GetEmailFromCode(code);
                Data.Security.ConfirmEmail.PageLoad(email);
                model.IsEmailConfirmed = true;
            }

            return model;
        }

    }
}
